
/**
 * Created by Administrator on 2016/9/5 0005.
 */
package com.cn.mmd.tools;

import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 加载oss配置
 *
 * @author Administrator
 */
public class AliyunOssConfig {
    public static String ACCESS_ID = "";
    public static String ACCESS_KEY = "";
    public static String OSS_ENDPOINT = "";
    public static String bucketName = "";
    static Log log = LogFactory.getLog(AliyunOssConfig.class);

    public static void load() {
        log.info("oss配置加载开始  ....");
        Properties prop = new Properties();
        try {
            prop.load(AliyunOssConfig.class.getResourceAsStream("/aliyunoss.properties"));
            ACCESS_ID = prop.getProperty("ACCESS_ID");
            ACCESS_KEY = prop.getProperty("ACCESS_KEY");
            OSS_ENDPOINT = prop.getProperty("OSS_ENDPOINT");
            bucketName = prop.getProperty("bucketName");
        } catch (Exception e) {
            log.error("oss配置加载失败");
        }
    }

    /**
     * @return the aCCESS_ID
     */
    public static String getACCESS_ID() {
        return ACCESS_ID;
    }

    /**
     * @param aCCESS_ID *            the aCCESS_ID to set
     */
    public static void setACCESS_ID(String aCCESS_ID) {
        ACCESS_ID = aCCESS_ID;
    }

    /**
     * @return the aCCESS_KEY
     */
    public static String getACCESS_KEY() {
        return ACCESS_KEY;
    }

    /**
     * @param aCCESS_KEY *            the aCCESS_KEY to set
     */
    public static void setACCESS_KEY(String aCCESS_KEY) {
        ACCESS_KEY = aCCESS_KEY;
    }

    /**
     * @return the oSS_ENDPOINT
     */
    public static String getOSS_ENDPOINT() {
        return OSS_ENDPOINT;
    }

    /**
     * @param oSS_ENDPOINT *            the oSS_ENDPOINT to set
     */
    public static void setOSS_ENDPOINT(String oSS_ENDPOINT) {
        OSS_ENDPOINT = oSS_ENDPOINT;
    }

    /**
     * @return the bucketName
     */
    public static String getBucketName() {
        return bucketName;
    }

    /**
     * @param bucketName *            the bucketName to set
     */
    public static void setBucketName(String bucketName) {
        AliyunOssConfig.bucketName = bucketName;
    }
}
